﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SMTC.BO.UserPower;
using SMTC.WebCommon.Common;
using System.Data;

public partial class UserPower_NewsList :BasePage
{
    private NewsListGridviewBind _newslist = new NewsListGridviewBind();
    private CheckNewsList _checknewslist = new CheckNewsList();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            GridviewNewsListbind();
        }
       
    }
    private void GridviewNewsListbind()
    {
        GridviewNewsList.DataSource = _newslist.SELECT_NewsList_GridViewBind(this.UserName.ToString());
        GridviewNewsList.DataBind();
    }

    protected void GridviewNewsList_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        if (e.NewPageIndex >= 0 && e.NewPageIndex < GridviewNewsList.PageCount)
            GridviewNewsList.PageIndex = e.NewPageIndex;
           GridviewNewsListbind();
    }
    protected void GridviewNewsList_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {

            e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#c2f6f4'");

            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
        }
        if (e.Row.RowIndex != -1)
        {
            int number = e.Row.RowIndex + 1;
            e.Row.Cells[0].Text = number.ToString();
        }
    }
}